package com.mep.auth.feign;

import com.mep.auth.model.SysUser;
import com.mep.common.http.HttpResult;
import com.mep.common.page.PageRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@FeignClient(value = "story-auth/user", path = "/")
public interface IFeignSysUserApi {

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/save")
    HttpResult save(@RequestBody SysUser record);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/delete")
    HttpResult delete(@RequestBody List<SysUser> records);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/findByName")
    HttpResult findByName(@RequestParam String name);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/findPermissions")
    HttpResult findPermissions(@RequestParam String name);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/findUserRoles")
    HttpResult findUserRoles(@RequestParam Long userId);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/findPage")
    HttpResult findPage(@RequestBody PageRequest pageRequest);

//    @ApiOperation(value="01.通过延迟1到5秒钟测试断路功能",notes="注意问题点:把需要注意的事项放这里")
//    @ApiOperationSupport(order = 1, author = "lyl")
    @PostMapping(value="/exportExcelUser")
    void exportExcelUser(@RequestBody PageRequest pageRequest, HttpServletResponse res);
}
